package com.dmwork.service.interaction.feign;

import com.dmwork.common.base.result.R;
import com.dmwork.service.base.vo.WorkCommonVo;
import com.dmwork.service.interaction.feign.impl.WorkFeignServiceFallback;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Service
@FeignClient(name = "service-work-center", fallback = WorkFeignServiceFallback.class)
public interface WorkFeignService {

    @PutMapping("/front/dm_work/work/me/feign/modify_work_collect_count/{workId}/{flag}")
    R modifyWorkCollectCount(@PathVariable("workId") String workId, @PathVariable("flag") Integer flag);

    @PutMapping("/front/dm_work/work/me/feign/modify_batch_work_collect_count/{flag}")
    R modifyBatchWorkCollectCount(@RequestBody List<String> workIdList, @PathVariable("flag") Integer flag);

    @ApiOperation("feign获取作品信息")
    @GetMapping("/admin/dm_work/work/feign/getWorkInfoByWorkId/{workId}")
    R<WorkCommonVo> getWorkInfoByWorkId(@PathVariable String workId);

    @ApiOperation("feign获取作品信息列表")
    @PostMapping("/admin/dm_work/work/feign/getWorkListByWorkIds")
    R<List<WorkCommonVo>> getWorkListByWorkIds(@RequestBody List<String> workIdList);
}
